<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	</head>
	<body>
		<h1 id="XML_Pivot_Export_Tool">XML Pivot Export Tool</h1>
		<table border="1">
			<tr>
				<td>
					<p>
						<img height="34" width="34" border="0" src="Images/14.2.%20Usage%20instructions_html_723ed3f9.png"/>
					</p>
				</td>
				<td>
					<p>The XML Pivot functionality is not integrated by default in Capella. This addon is available for download on the Capella website.</p>
				</td>
			</tr>
		</table>
		<h2 id="Export">Export</h2>
		<p>To export a model or parts of a model select the elements to be exported in the Capella Project Explorer, open the context menu and select “Pivot XML -&gt; Export”.</p>
		<p>This will open a file dialog which allows choosing the destination file for the export. Press OK in the file dialog to continue the export. After the export completes, a status dialog shows the elements that have been excluded from the export because they do not form part of the Capella simplified metamodel.</p>
		<p>
			<img border="0" src="Images/XMLPivot_Export.png"/>
		</p>
		<p>It is possible to hide all trace elements from the dialog by deselecting the checkbox “Show abstract trace elements”. The elements in this list are also shown in the Information view in order to conserve the report even after the dialog is closed. After closing the dialog, the export tool offers to open the exported xml file in an editor.</p>
		<p>After confirmation, a basic editor allows to inspect the export result:</p>
		<p>
			<img border="0" src="Images/XMLPivot_Export_Result.png"/>
		</p>
		<p>It is also possible to modify the export result via the Properties View. If the Properties View is not open, you can open it by selecting “Show Properties View” in the context menu of any element in the Editor.</p>
		<h2 id="Command-line_Export">Command-line Export</h2>
		<p>It is possible to export a Capella model with the Capella headless command-line application. The command to run an export in headless mode is:</p>
		<p><blockquote>
			eclipse.exe -consoleLog -application org.polarsys.capella.core.commandline.core -appid xmlpivot.export -filePath &lt;Path&gt;
</blockquote></p>
		<p>The filePath argument may either be a relative or an absolute path. If it is a relative path, it is interpreted relative to the workspace. To specify an explicit workspace, you can use an additional parameter: </p>
		<p><blockquote>
			eclipse.exe –data &lt;Path to Workspace&gt; -consoleLog -application org.polarsys.capella.core.commandline.core -appid xmlpivot.export -filePath &lt;Path&gt;
</blockquote></p>
		<p>
			<b>Examples:</b>
		</p>
		<p><blockquote>
			eclipse.exe -consoleLog -application org.polarsys.capella.core.commandline.core -appid xmlpivot.export -filePath C:/EOLE_AF/EOLE_AF.melodymodeller
</blockquote>
<blockquote>
			eclipse.exe -consoleLog -application org.polarsys.capella.core.commandline.core -appid xmlpivot.export -filePath EOLE_AF/EOLE_AF.melodymodeller
</blockquote></p>
		<h2 id="The_Simplified_Capella_Metamodel_Project">The Simplified Capella Metamodel Project</h2>
		<p>Note that the export also creates an additional project “Simplified Capella Metamodel” in the workspace. This project will contain .ecore (Similar to XML Schema) definitions of the simplified Capella Metamodel. This project should not be deleted, as it is required to open the exported model in the basic editor, or any other EMF based tool that has to load the exported model. To share your exported model with others, always share the “Simplified Capella Metamodel” project too.</p>
		<h2 id="New_Capella_Project_From_XML_Pivot">New Capella Project From XML Pivot</h2>
		<p>It is possible to initialize a new Capella project from a simplified Capella model: Open the Capella Project explorer context menu and select “New -&gt; Capella Project from XML Pivot”. This will open the Capella Project Wizard with an additional step that allows selecting the source .xml file:</p>
		<p>
			<img border="0" src="Images/XMLPivot_Import_Wizard.png"/>
		</p>
		<p>
			<i>TIP: IF THE SOURCE .XML FILE IS INSIDE THE CAPELLA WORKSPACE, YOU CAN SELECT THE .XML FILE AND THEN OPEN THE WIZARD. THIS WILL AUTOMATICALLY SET THE LOCATION FIELD TO THE PATH OF THE PREVIOUSLY SELECTED FILE.</i>
		</p>
		<p>After filling out the remaining steps of the Capella Project Wizard click “Finish” to create the project.</p>
		<h2 id="Merge_With_Existing_Capella_Project">Merge With Existing Capella Project</h2>
		<p>It is possible to import a simplified Capella model and merge it directly into an existing Capella project. To merge such a model, select its .xml file in the Capella Project Explorer and select “Pivot XML -&gt; Merge with existing Capella Project”. These commands will import the source .xml file and open the interactive Capella Diff/Merge editor.</p>
		<h2 id="Viewpoint_Addon_Support">Viewpoint Addon Support</h2>
		<p>The XMLPivot tool comes with automatic support for metamodel extensions provided through viewpoint addons. During export, all required external viewpoint metamodels are transformed automatically into a corresponding meta model that is compatible with the simplified Capella meta model. The .ecore file for the simplified viewpoint meta model is then stored inside the “Simplified Capella Metamodel” project, alongside the simplified Capella meta model .ecore files.</p>
		<h2 id="Developer_Information">Developer Information</h2>
		<p>The following sections are of interest for XML Pivot developers.</p>
		<h3 id="Code_generation_for_the_simplified_Capella_metamodel">Code generation for the simplified Capella metamodel</h3>
		<p>The plugin org.polarsys.capella.core.semantic.data.gen contained generated EMF code for the simplified Capella metamodel. This code is not needed by the XML Pivot addon and was removed from XML Pivot in version 1.1.0. The following two steps show how developers can generate this code for their own projects:</p>
		<h4 id="Launch_the_semantic_metamodel_generation_application">Launch the semantic metamodel generation application</h4>
		<p>The semantic metamodel generation application is a capella command line application that creates all required .ecore and .genmodel files. The following command runs this application from a command line:</p>
		<p><code>C:\capella&gt;capella.exe -data C:\workspace -application -appid org.polarsys.capella.xmlpivot.commandline.m2extraction</code></p>
		<p>This will create a project org.polarsys.capella.core.semantic.data.gen in the specified workspace (in this example <code>C:\workspace</code>)</p>
		<h4 id="Generate_code">Generate code</h4>
		<p>Launch capella and switch to the workspace that contains the generated project, open the CapellaModeller.genmodel file and select "Generate Model Code" from the context menu.</p>
	</body>
</html>